import request from '@/utils/request'

// 登录方法
export function login(username, code) {
  const data = {
    account: username,
    code: code
  }
  return request({
    url: '/h5protal/portal/quick_login',
    method: 'post',
    data: data
  })
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/api/user/getinfo',
    method: 'get'
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

// 获取验证码
export function getQlCode(to) {
  return request({
    url: '/h5protal/portal/send_qlcode?to=' + to,
    method: 'get'
  })
}

// 刷新token  /api/auth/refresh_token
export function refreshToken(refreshToken) {
  return request({
    url: '/api/auth/refresh_token?refreshToken=',
    method: 'post'
  })
}

// 完善资料 /h5protal/portal/add_info
export function addInfo(data) {
  return request({
    url: '/h5protal/user/add_info',
    method: 'post',
    data: data
  })
}
